package com.ticket.sass.admin.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ticket.sass.common.entity.tenant.OrderCouponMapEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ywb
 * @date 2024-04-17 14:35
 */
public interface OrderCouponMapMapper extends BaseMapper<OrderCouponMapEntity> {
    @Select("""
        SELECT
            map.*, coupon.name AS coupon_name
        FROM
            order_coupon_maps map
        LEFT JOIN
            coupons coupon
        ON
            map.coupon_id = coupon.id
        ${ew.customSqlSegment}
        """)
    List<OrderCouponMapEntity> queryList(@Param(Constants.WRAPPER) QueryWrapper<OrderCouponMapEntity> queryWrapper);
    
}
